package Model.StatisticalReport;

public enum ReportClass {
    DEPARTMENT(1, "`nursing_records_datatable_department`", true),
    HOME(2, "`nursing_records_datatable_home`", true),
    EVALUATE(3, "`nursing_records_datatable_evaluate`", true);
//    HOME_SUMMARY(11, "`db_chx_statistics_home_summary`"),
//    DEPARTMENT_SUMMARY(12, "`db_chx_statistics_department_summary`"),
//    EVALUATE_SUMMARY(13, "`db_chx_statistics_evaluate_summary`");


    private int schemaId;
    private String schemaName;

    private boolean fDetail;

    public int getSchemaId() {
        return schemaId;
    }

    public String getSchemaName() {
        return schemaName;
    }

    /**
     * 通过SchemaId取枚举
     * @param schemaId
     * @return
     */
    public static ReportClass get(int schemaId){
        for (ReportClass enums : ReportClass.values()) {
            if (enums.getSchemaId() == schemaId) {
                return enums;
            }
        }
        return null;
    }

    ReportClass(int schemaId, String schemaName){
        this.schemaId = schemaId;
        this.schemaName = schemaName;
        this.fDetail = false;
    }

    ReportClass(int schemaId, String schemaName, boolean fDetail){
        this.schemaId = schemaId;
        this.schemaName = schemaName;
        this.fDetail = fDetail;
    }

    public boolean isDetail(){
        return fDetail;
    }

    public String toString(){return this.getSchemaName();}

}
